<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- ## 7.要求：检查一个字符串是否以指定的字符串结尾。
    ```javascript
        function(){
            
        }
        fun(arr,value)
    ``` -->
    <script>
        var str='abcdef';
        function fun(str,value){
            var res=str.length-value.length;
            var res1=str.substr(res,value.length)
            if(res1===value){
                return true;
            }else{
                return false;
            }
        }
        console.log(fun(str,'f'));
         
    </script>
</body>

</html>